export function isMicroApp() {
  // @ts-ignore
  return typeof window !== 'undefined' && window.__POWERED_BY_QIANKUN__ !== undefined;
}

export function getToken() {
  const token = localStorage.getItem('access_token');
  if (token === 'null' || token === 'undefined' || token === null) {
    return '';
  }
  return token;
}

export function appendScript(src, cb){
  const script = document.createElement('script')
  script.src = src;
  script.onload = () => {
    cb && cb()
  }
  document.append(script)
}
